package com.example.workflow.mapper;

import com.example.workflow.entity.SysSystem;
import org.apache.ibatis.annotations.*;

import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@Mapper
public interface SysSystemMapper extends BaseMapper<SysSystem> {

    
    @Insert("INSERT INTO sys_system(system_code, system_name, description, status,del_flag) " +
            "VALUES(#{systemCode}, #{systemName}, #{description}, #{status},#{delFlag})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    int insert(SysSystem system);

    @Update("UPDATE sys_system SET system_name = #{systemName}, description = #{description}, " +
            "status = #{status} WHERE id = #{id}")
    int update(SysSystem system);

    @Select("SELECT * FROM sys_system WHERE id = #{id}")
    SysSystem findById(Long id);

    @Select("SELECT * FROM sys_system where del_flag = 0 ORDER BY create_time DESC")
    List<SysSystem> findAll();
} 